﻿using Microsoft.EntityFrameworkCore;

namespace Yqd.Models
{
    public class YqdContext : DbContext
    {
        public YqdContext(DbContextOptions<YqdContext> options) : base(options)
        {
        }

        public YqdContext()
        {
        }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(Adp.Env.DbContextSetting(optionsBuilder, "DefaultConnection"));
        }
        public DbSet<Yqd_Department> Yqd_Department { get; set; }
        public DbSet<Yqd_User> Yqd_User { get; set; }
        public DbSet<Yqd_Supervise> Yqd_Supervise { get; set; }
        public DbSet<Yqd_Assign> Yqd_Assign { get; set; }
        public DbSet<Yqd_Scheme> Yqd_Scheme { get; set; }
        public DbSet<Yqd_SchemeApproval> Yqd_SchemeApproval { get; set; }
        public DbSet<Yqd_FinishReport> Yqd_FinishReport { get; set; }
        public DbSet<Yqd_JobPlan> Yqd_JobPlan { get; set; }
        public DbSet<Yqd_PlanProgress> Yqd_PlanProgress { get; set; }
        public DbSet<Yqd_Unit> Yqd_Unit { get; set; }
        public DbSet<Yqd_UnitLeader> Yqd_UnitLeader { get; set; }
        public DbSet<Yqd_Person> Yqd_Person { get; set; }
        public DbSet<Yqd_TaskPlan> Yqd_TaskPlan { get; set; }
        public DbSet<Yqd_Task> Yqd_Task { get; set; }
        public DbSet<Yqd_Quota> Yqd_Quota { get; set; }
        public DbSet<Yqd_Milestone> Yqd_Milestone { get; set; }
        public DbSet<Yqd_EvaluateResult> Yqd_EvaluateResult { get; set; }
        public DbSet<Yqd_EvaluateInfo> Yqd_EvaluateInfo { get; set; }

        //wyg
        public DbSet<Yqd_IntegralRule> Yqd_IntegralRule { get; set; }
        public DbSet<Yqd_Rank> Yqd_Rank { get; set; }
        public DbSet<Yqd_NewRank> Yqd_NewRank { get; set; }
        public DbSet<Yqd_TaskType> Yqd_TaskType { get; set; }
        public DbSet<Yqd_TaskLog> Yqd_TaskLog { get; set; }
        public DbSet<Yqd_Cooperative> Yqd_Cooperative { get; set; }
        public DbSet<Yqd_Coordinate> Yqd_Coordinate { get; set; }
        public DbSet<Yqd_ExactSupervise> Yqd_ExactSupervise { get; set; }
        public DbSet<Yqd_Logging> Yqd_Logging { get; set; }
        public DbSet<Yqd_SuperviseNo> Yqd_SuperviseNo { get; set; }
        public DbSet<Yqd_SpecialTask> Yqd_SpecialTask { get; set; }
        public DbSet<Yqd_SpecialStandard> Yqd_SpecialStandard { get; set; }
        public DbSet<Yqd_SpecialTemplate> Yqd_SpecialTemplate { get; set; }
        public DbSet<Yqd_SpecialSupervise> Yqd_SpecialSupervise { get; set; }
        public DbSet<Yqd_PlanFlow> Yqd_PlanFlow { get; set; }
        public DbSet<Yqd_PlanSchedule> Yqd_PlanSchedule { get; set; }

        public DbSet<Yqd_MilestoneNew> Yqd_MilestoneNew { get; set; }
        public DbSet<Yqd_QuotaNew> Yqd_QuotaNew { get; set; }

        public DbSet<Yqd_QuotaMsg> Yqd_QuotaMsg { get; set; }

        public DbSet<Yqd_QuotaField> Yqd_QuotaField { get; set; }

        public DbSet<Yqd_QuotaPlan> Yqd_QuotaPlan { get; set; }

        public DbSet<Yqd_QuotaTable> Yqd_QuotaTable { get; set; }

        public DbSet<Yqd_TaskPlanQuestion> Yqd_TaskPlanQuestion { get; set; }

        public DbSet<Yqd_MsgLog> Yqd_MsgLog { get; set; }

        public DbSet<Yqd_TaskError> Yqd_TaskError { get; set; }

        public DbSet<detection_rsj_rczb_data> detection_rsj_rczb_data { get; set; }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {

            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity<Yqd_Department>().ToTable("Yqd_Department");
            modelBuilder.Entity<Yqd_User>().ToTable("Yqd_User");
            modelBuilder.Entity<Yqd_Supervise>().ToTable("Yqd_Supervise");
            modelBuilder.Entity<Yqd_Assign>().ToTable("Yqd_Assign");
            modelBuilder.Entity<Yqd_Scheme>().ToTable("Yqd_Scheme");
            modelBuilder.Entity<Yqd_SchemeApproval>().ToTable("Yqd_SchemeApproval");
            modelBuilder.Entity<Yqd_FinishReport>().ToTable("Yqd_FinishReport");
            modelBuilder.Entity<Yqd_JobPlan>().ToTable("Yqd_JobPlan");
            modelBuilder.Entity<Yqd_PlanProgress>().ToTable("Yqd_PlanProgress");
            modelBuilder.Entity<Yqd_Unit>().ToTable("Yqd_Unit");
            modelBuilder.Entity<Yqd_UnitLeader>().ToTable("Yqd_UnitLeader");
            modelBuilder.Entity<Yqd_Person>().ToTable("Yqd_Person");
            modelBuilder.Entity<Yqd_TaskPlan>().ToTable("Yqd_TaskPlan");
            modelBuilder.Entity<Yqd_Task>().ToTable("Yqd_Task");
            modelBuilder.Entity<Yqd_Quota>().ToTable("Yqd_Quota");
            modelBuilder.Entity<Yqd_Milestone>().ToTable("Yqd_Milestone");
            modelBuilder.Entity<Yqd_EvaluateResult>().ToTable("Yqd_EvaluateResult");
            modelBuilder.Entity<Yqd_EvaluateInfo>().ToTable("Yqd_EvaluateInfo");
            modelBuilder.Entity<Yqd_IntegralRule>().ToTable("Yqd_IntegralRule");
            modelBuilder.Entity<Yqd_Rank>().ToTable("Yqd_Rank");
            modelBuilder.Entity<Yqd_TaskType>().ToTable("Yqd_TaskType");
            modelBuilder.Entity<Yqd_TaskLog>().ToTable("Yqd_TaskLog");
            modelBuilder.Entity<Yqd_Cooperative>().ToTable("Yqd_Cooperative");
            modelBuilder.Entity<Yqd_Coordinate>().ToTable("Yqd_Coordinate");
            modelBuilder.Entity<Yqd_ExactSupervise>().ToTable("Yqd_ExactSupervise");
            modelBuilder.Entity<Yqd_Logging>().ToTable("Yqd_Logging");
            modelBuilder.Entity<Yqd_SuperviseNo>().ToTable("Yqd_SuperviseNo");
            modelBuilder.Entity<Yqd_SpecialTask>().ToTable("Yqd_SpecialTask");
            modelBuilder.Entity<Yqd_SpecialStandard>().ToTable("Yqd_SpecialStandard");
            modelBuilder.Entity<Yqd_SpecialTemplate>().ToTable("Yqd_SpecialTemplate");
            modelBuilder.Entity<Yqd_SpecialSupervise>().ToTable("Yqd_SpecialSupervise");
            modelBuilder.Entity<Yqd_PlanFlow>().ToTable("Yqd_PlanFlow");
            modelBuilder.Entity<Yqd_PlanSchedule>().ToTable("Yqd_PlanSchedule");

            modelBuilder.Entity<Yqd_MilestoneNew>().ToTable("Yqd_MilestoneNew");
            modelBuilder.Entity<Yqd_QuotaNew>().ToTable("Yqd_QuotaNew");
            modelBuilder.Entity<Yqd_QuotaMsg>().ToTable("Yqd_QuotaMsg");

            modelBuilder.Entity<Yqd_QuotaField>().ToTable("Yqd_QuotaField");
            modelBuilder.Entity<Yqd_QuotaPlan>().ToTable("Yqd_QuotaPlan");
            modelBuilder.Entity<Yqd_QuotaTable>().ToTable("Yqd_QuotaTable");
            modelBuilder.Entity<Yqd_TaskPlanQuestion>().ToTable("Yqd_TaskPlanQuestion");

            modelBuilder.Entity<Yqd_MsgLog>().ToTable("Yqd_MsgLog");
            modelBuilder.Entity<Yqd_TaskError>().ToTable("Yqd_TaskError");

            modelBuilder.Entity<detection_rsj_rczb_data>().ToTable("detection_rsj_rczb_data");


        }

        //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        //{
        //    //base.OnConfiguring(optionsBuilder);
        //    //var log = Fn.GetService<ILoggerFactory>();
        //    //if (log != null)
        //    //{
        //    //    optionsBuilder.UseLoggerFactory(log);
        //    //}
        //}
    }
}
